package atlantik.ui;

import javax.swing.JCheckBox;

import atlantik.game.Atlantik;
import atlantik.game.Game;
import atlantik.game.Game.Option;
import atlantik.game.Game.Option.ChangeAction;

public class GameOptionView extends JCheckBox {

	public class OptionAction extends ClientAction<ChangeAction> {
		OptionAction(ChangeAction action) {
			super(action);
		}
		
		@Override
		public void updated(ChangeAction action) {
			super.updated(action);
			putValue(SELECTED_KEY, action.isSelected());
		}
	}

	private final OptionAction action;

	public GameOptionView(Atlantik client, Option item) {
		action = new OptionAction(Game.Option.CHANGE.getActionInstance(client, item));
		setAction(action );
	}
	
}
